﻿Public Class AddingTags
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles bt_SubTag.Click
        Dim oleDbcom As New OleDb.OleDbConnection(ConfigurationManager.ConnectionStrings("Phones").ConnectionString)
        oleDbcom.Open()
        Dim sqlString As String = "INSERT INTO TAGS(TagName) VALUES(@f1)"
        Dim cm As OleDb.OleDbCommand = New OleDb.OleDbCommand(sqlString, oleDbcom)
        cm.Parameters.AddWithValue("@f1", tb_addTag.Text)
        cm.CommandType = CommandType.Text
        cm.ExecuteNonQuery()
        oleDbcom.Close()
        cm.Dispose()
        oleDbcom.Dispose()
        Response.Redirect("Tags.aspx")
        lb_Tag.Text = "Thank you for adding Tag into the Database"
    End Sub
End Class